package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import edu.ynu.se.xiecheng.achitectureclass.dao.SoilPHDao;
import edu.ynu.se.xiecheng.achitectureclass.dto.DataDTO;
import edu.ynu.se.xiecheng.achitectureclass.entity.SoilPH;
import edu.ynu.se.xiecheng.achitectureclass.service.SoilPHService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "土壤PH值实体的控制器")
@RestController
@RequestMapping("/soilPH")
public class SoilPHController extends LogicController<SoilPHService, SoilPHDao, SoilPH,Long> {
    public SoilPHController(SoilPHService service) { super(service); }

    @ApiOperation("获取最近7个土壤PH值的数据")
    @GetMapping("/get7Data")
    public List<DataDTO> getAllData(){
        return service.get7Data();
    }
}
